emit fixes for improperly annotated symbols#57
Merged
compnerd merged 2 commits intocompnerd:mainfrom Jul 8, 2025
Merged
Conversation
68e1c63 to
7198d06
Compare
7198d06 to
60672a4
Compare
compnerd
reviewed
Jul 8, 2025
compnerd
approved these changes
Jul 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Update ids to emit fixes to remove export annotations in places where they may cause problems.
Overview
This patch updates ids so that it emits FixIts to remove export annotation macros in places where they may cause problems. It is intentionally less aggressive at removing annotations than it could be.
The export annotation is removed in the following cases:
externorstaticmember fieldsstaticmember fields that are initialized inlineThe following specific changes were made to the ids implementation:
check_symbol_not_exportedmethod reports the new improper export diagnostic if the specified symbol has an export annotation.export_function_if_neededandexport_variable_if_neededso that some checks occur earlier. This is done because we only report mistaken annotations in a subset of cases where we would choose to not add them.check_symbol_not_exportedfromexport_function_if_neededandexport_variable_if_neededin cases where we want to remove annotations when present.Tests/lit.cfgto setconfig.supports_substitutions = True. This enables if/else conditional check on Windows in the new test case fileTests/lit.cfgto setsystem-windowswhen running on Windows. This lets us special-case Windows in the new test case file. Required because idt will fail (due to compilation failure) with a non-zero exit code in some cases when symbols are annotated for DLL export.Validation